﻿Public Class VariableValueToFilterConverter
    Implements Windows.Data.IValueConverter


    Public Property ColumnName As String

    Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements Windows.Data.IValueConverter.Convert
        Dim v As String = If(String.IsNullOrEmpty(value), "''", "'" & value.ToString() & "'")

        Return "(" & ColumnName & " = " & v & ")"
    End Function

    Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements Windows.Data.IValueConverter.ConvertBack
        Throw New NotImplementedException()
    End Function
End Class
